<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <style>
        * {
            margin: 0;
            padding: 0;
            list-style: none;
        }

        body {
            background-color: #F5F5F5;
        }

        .box {
            margin: 50px auto;
            width: 500px;
            height: 500px;
            background-color: white;
            border-radius: 5px;
            box-shadow: 2px 2px 8px 0px #b49f7a;
            position: relative;
            background-image: url(./2f90ebf69d83b7989827f92c27c5ee2f.jpeg);
        }

        .nav {
            width: 500px;
            padding-top: 70px;
            font-size: 30px;
            font-weight: 700;
            text-align: center;
        }

        .box .input-group span {
            padding: 15px;
            font-size: 20px;
            font-weight: 400;
        }

        .box .input-group input {
            padding: 25px;
            font-size: 10px;

        }

        .login {
            width: 80px;
            height: 50px;
            margin-top: 35px;
            font-size: 20px;
            font-weight: 400;
        }

        .res {
            position: absolute;
            bottom: 130px;
            right: 80px;
        }

        .res button {
            width: 100px;
            height: 50px;
            color: black;
            font-size: 20px;
            font-weight: 400;
        }
    </style>
</head>

<body>
    <div class="box">
        <div class="nav">学生管理登录系统</div>
        <div style="padding: 50px 80px 10px;">
            <form class="bs-example bs-example-form" role="form">
                <div class="input-group">
                    <span class="input-group-addon">账号</span>
                    <input type="text" class="form-control" placeholder="请输入您的账号">
                </div>
                <br>
                <div class="input-group">
                    <span class="input-group-addon">密码</span>
                    <input type="text" class="form-control" placeholder="密码至少9-16位且必须含有数字,字母">
                </div>
                <input type="submit" value="登录" class="login">
            </form>
        </div>
        <a href="./zhuce.html" class="res"><button>免费注册</button></a>
    </div>
    <script>
       /*  var inps = document.querySelectorAll("input");
        document.forms[0].onsubmit = function (e) {
            e.preventDefault();
            var username = inps[0].value;
            var password = inps[1].value;
            var pat = /^(?=.*[a-zA-Z])(?=.*\d).{9,16}$/
            var u = pat.exec(username);
            var p = pat.exec(password);
            if (u && p) {
                fetch(`/login?username=${username}&password=${password}`, {
                    method: "get",
                }).then(function (res) {
                    return res.json()
                }).then((data) => { // 返回服务器发送的内容
                    if (data == 1){
                        alert("登录成功");
                    }else if (data == 0){
                        alert("密码错误") 
                    }else if (data == 11){
                        alert("用户名不存在")
                    }

                })
            } else {
                alert("账号或密码不合法")
            }
        } */

    </script>
</body>

</html>